<?php 
class Zen_Redirector_Redirect301 {
	
	public static function redirect($config) {
		$url=mb_strtolower(trim($_SERVER['REQUEST_URI']));
		$file=file( ROOT_PATH . '/redirect');
		$data=array();
		foreach ($file as $string){
			$c=explode(' ',$string );
			$data[trim($c[0])]=trim($c[1]);
		}
		if(isset($data[$url])){
			Header( "HTTP/1.1 301 Moved Permanently" );
			Header( "Location: ". $config->domen . $data[$url] ); 
			exit();
		}
	}
	
}